package rs.frenjoynet.core.core;

import common.db.id.ProtectedStringIdObject;
import common.db.id.ProtectedIdObject;

import java.util.Date;

import rs.frenjoynet.core.core.entity.db.Information;
import rs.frenjoynet.core.core.entity.db.User;

/**
 * Created by IntelliJ IDEA.
 * User: ppopovic
 * Date: 22.10.2009.
 * Time: 14.45.58
 * To change this template use File | Settings | File Templates.
 */

public class ActiveUserSession extends ProtectedStringIdObject
{
	// id is String because may be we should move to generating GUIDs as session ids

	private String guid;
	private String email;
	private String webSessionUid;
	private Date beginDate;
	private String userAgent;
	private String ip;
	private Date lastPingDate;

	private String rowId;
	private LoginKind loginKind;
	private User user;
	private Information information;
//	private String languageId;


	protected ActiveUserSession()
	{
	}

	@Override
	protected void setId(String id)
	{
		super.setId(id);
	}

	@Override
	public String getId()
	{
		return super.getId();
	}





	public String getWebSessionUid()
	{
		return webSessionUid;
	}

	protected void setWebSessionUid(String webSessionUid)
	{
		this.webSessionUid = webSessionUid;
	}

	public String getGuid()
	{
		return guid;
	}

	protected void setGuid(String guid)
	{
		this.guid = guid;
	}

	public Date getBeginDate()
	{
		return beginDate;
	}

	protected void setBeginDate(Date beginDate)
	{
		this.beginDate = beginDate;
	}

	public String getUserAgent()
	{
		return userAgent;
	}

	protected void setUserAgent(String userAgent)
	{
		this.userAgent = userAgent;
	}

	public String getIp()
	{
		return ip;
	}

	protected void setIp(String ip)
	{
		this.ip = ip;
	}

	public Date getLastPingDate()
	{
		return lastPingDate;
	}

	protected void setLastPingDate(Date lastPingDate)
	{
		this.lastPingDate = lastPingDate;
	}

	public String getRowId()
	{
		return rowId;
	}

	protected void setRowId(String rowId)
	{
		this.rowId = rowId;
	}

	public String getEmail()
	{
		return email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	@Override
	public String toString()
	{
		return "ActiveUserSession{" +
				"guid='" + guid + '\'' +
				", email=" + email +
				", webSessionUid='" + webSessionUid + '\'' +
				", beginDate=" + beginDate +
				", userAgent='" + userAgent + '\'' +
				", ip='" + ip + '\'' +
				", lastPingDate=" + lastPingDate +
				", rowId='" + rowId + '\'' +
				'}';
	}

	public LoginKind getLoginKind()
	{
		return loginKind;
	}

	protected void setLoginKind(LoginKind loginKind)
	{
		this.loginKind = loginKind;
	}

	public User getUser()
	{
		return user;
	}

	public void setUser(User user)
	{
		this.user = user;
	}

	public Information getInformation()
	{
		return information;
	}

	public void setInformation(Information information)
	{
		this.information = information;
	}
}
